﻿using System;
using System.Diagnostics.Contracts;
using CardPlay.Model.GameModel.Actions;

namespace CardPlay.Model.GameModel
{
    [ContractClass(typeof(CodeContractForIPlayingRules))]
    public interface IPlayingRules
    {
        bool Permit(GameAction action);
    }

    [ContractClassFor(typeof(IPlayingRules))]
    internal abstract class CodeContractForIPlayingRules : IPlayingRules
    {
        public bool Permit(GameAction action)
        {
            Contract.Requires<ArgumentNullException>(action != null);
            return default(bool);
        }
    }
}
